/*
chrome.extension.onRequest.addListener(function(request, sender, sendResponse){
    if(request.novos_tweets)
    {
      sendResponse({
        'tweets': fec.last(request.tm, request.total, request.max)
      });
    }

    if(request.traduz)
    {
      var re;
        if(typeof(request.texto) === 'object'){
          re = [];
          for(i in request.texto){
              re[i] = Traduz(request.texto[i]);
          }
        }else{
          re = Traduz(request.texto);
        }
        sendResponse({
          'traduzido': re,
          'usuario': db.pega('user'),
          'logado': db.pega('logado')
        });
    }

    if(request.GetConfig)
    {
        sendResponse({'config': config});
    }

    if(request.shareVideo)
    {
        console.log('Sharing Video...');
        var titulo = request.videoTitle;
        var id     = request.videoID;
        var URL    = ': http://youtu.be/'+id;
        var txt;

        if(140 < titulo.length +URL.length){
            var tirar = 140 -URL.length -3; // 140 -url -3 (dots)
            txt = [];
            for (var i = 0; i < tirar; i++){
                txt[i] = titulo.charAt(i);
            }
            txt[i] = '...';
            txt = txt.join('') +URL;
        }
        else{
            txt = titulo +URL;
        }

        Chrowety.update(txt, null, 'home', function(OK, tid)
        {
            if(OK) Utils.Notify.Individual(tid, 'home');
            sendResponse({'enviou':OK});
        });
    }

});
*/